package com.jumi.microservice.stock.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jumi.microservice.stock.domain.StockConversionDetailDO;
import com.jumi.microservice.stock.domain.StockConversionDetailDTO;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Description
 * @ClassName StockConversionDetailMapper
 * @Author Abel Yang
 * @Date 2020/9/16/016 13:46
 **/
public interface StockConversionDetailMapper extends BaseMapper<StockConversionDetailDO> {

    @Select("<script>" +
            "select c.id,c.material_id,c.material_code,c.conversion_id,c.conversion_num,m.bar_code,m.spec_name,m.weight" +
            " from jm_stock_conversion_detail as c join jm_material as m" +
            " on c.material_id=m.material_id" +
            " where c.is_del = 0 and c.conversion_id=#{conversionId}" +
            "</script>")
    List<StockConversionDetailDTO> getDetailByConversionId(Long conversionId);
}
